﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WareHouse.Domain.Procurements
{
    /// <summary>
    /// 采购表
    /// </summary>
    [SugarTable("Procurement")]
    public class Procurement : AuditInfo
    {
        /// <summary>
        /// 采购ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public long ProcurementId { get; set; }

        /// <summary>
        /// 采购单号
        /// </summary>
        [SugarColumn(Length = 50)]
        public string ProcurementCode { get; set; }

        /// <summary>
        /// 供应商ID外键
        /// </summary>
        public int SupplierId { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        [SugarColumn(Length = 30)]
        public string ContactName { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [SugarColumn(Length = 11)]
        public string Phone { get; set; }

        /// <summary>
        /// 收货时间
        /// </summary>
        public DateTime ReceiptTime { get; set; }

        /// <summary>
        /// 采购人
        /// </summary>
        [SugarColumn(Length = 30)]
        public string MakerName { get; set; }

        /// <summary>
        /// 采购时间
        /// </summary>
        public DateTime MakerTime { get; set; }

        /// <summary>
        /// 是否入账
        /// </summary>
        public bool IsEntry { get; set; }

        /// <summary>
        /// 是否退货
        /// </summary>
        public bool IsReFund { get; set; }

        /// <summary>
        /// 采购订单状态
        /// </summary>
        public ProcurementStatus ProcurementStatus { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(Length = 500)]
        public string Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }= DateTime.Now;
    }

    /// <summary>
    /// 采购订单状态
    /// </summary>
    public enum ProcurementStatus
    {
        全部入库=1,
        部分入库,
        订单取消,
        采购中
    }
}
